<script lang="ts" setup>
import { useAuthStore } from '@/store'

const { sessionid, loginMode } = storeToRefs(useAuthStore())
function goSelect() {
  uni.navigateTo({
    url: '/pages-sub/apply/select',
  })
}
function goList() {
  if (sessionid.value && loginMode.value === 'apply') {
    uni.navigateTo({
      url: '/pages-sub/apply/list',
    })
  }
  else {
    uni.navigateTo({
      url: '/pages-sub/apply/login?from=applyIndex',
    })
  }
}
</script>

<template>
  <div class="apply">
    <nut-cell-group>
      <nut-cell title="商户录入" is-link @click="goSelect">
        <template #icon>
          <div class="li-icon" style="color: #5481f4;background-color: #e9f5fe;">
            <div class="i-ri:briefcase-2-fill icon"></div>
          </div>
        </template>
        <template #link>
          <div class="i-ri:arrow-right-s-line rightIcon"></div>
        </template>
      </nut-cell>
      <nut-cell title="进度查询" is-link @click="goList">
        <template #icon>
          <div class="li-icon" style="color: #47b653;background-color: #e8fcee;">
            <div class="i-ri:progress-1-line icon"></div>
          </div>
        </template>
        <template #link>
          <div class="i-ri:arrow-right-s-line rightIcon"></div>
        </template>
      </nut-cell>
    </nut-cell-group>
  </div>
</template>

<route lang="json">
{
  "style": {
    "navigationBarTitleText": "商户申请",
    "backgroundColorContent": "#f1f1f1"
  }
}
</route>

<style lang="sass" scoped>
.apply
  padding: 32rpx
  .li-icon
    width: 32px
    height: 32px
    border-radius: 22rpx
    margin-right: 5px
    display: flex
    align-items: center
    justify-content: center
    .icon
      width: 18px
      height: 18px

:deep(.nut-cell)
  padding-bottom: 25rpx
  padding-top: 25rpx
  font-size: 31rpx
  display: flex
  align-items: center
  
</style>
